<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>订单管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/eb/order/">订单列表</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="order" action="${ctx}/eb/order/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>订单流水号：</label>
				<form:input path="orderCode" htmlEscape="false" maxlength="64" class="input-medium"/>
			</li>
			<li><label>买家：</label>
				<form:input path="recipientName" htmlEscape="false" maxlength="64" class="input-medium"/>
			</li>
			<li><label>商品数量：</label>
				<form:input path="productQuantity" htmlEscape="false" maxlength="11" class="input-medium"/>
			</li>
			<li><label>总价：</label>
				<form:input path="productTotalFee" htmlEscape="false" class="input-medium"/>
			</li>
			<li><label>状态：</label>
				<form:input path="status" htmlEscape="false" maxlength="3" class="input-medium"/>
			</li>
			<li><label>运费：</label>
				<form:input path="transportFee" htmlEscape="false" class="input-medium"/>
			</li>
			<li><label>实际支付：</label>
				<form:input path="customerPaidFee" htmlEscape="false" class="input-medium"/>
			</li>
<%-- 			<li><label>支付渠道：</label>
				<form:input path="payChannel" htmlEscape="false" maxlength="45" class="input-medium"/>
			</li> --%>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>订单流水号</th>
				<th>总价</th>
				<th>状态</th>
				<th>下单日期</th>
				<th>买家</th>
				<th>联系方式</th>
				<th>地址</th>
				<th>备注</th>
				<shiro:hasPermission name="eb:order:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="order">
			<tr>
				<td><a href="${ctx}/eb/order/form?id=${order.id}">
					${order.orderCode}
				</a></td>
				<td>
					${order.productTotalFee}
				</td>
				<td>
					<script type="text/javascript">
					var type = '${order.status}';
					var result = "其他";
					if(type=="010")result="待支付";
					else if(type=="020")result="已支付";
					document.write(result);
				</script>
				</td>
				<td>
					<fmt:formatDate value="${order.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					${order.recipientName}
				</td>
				<td>
					${order.recipientContact}
				</td>
				<td>
					${order.recipientAddress}
				</td>
				<td>
					${order.remarks}
				</td>
				<shiro:hasPermission name="eb:order:edit"><td>
    				<a href="${ctx}/eb/order/form?id=${order.id}">修改</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>